package com.shoulei.designpattern.abstractFactoryPattern;

/**
 * @ClassName:ShapeFactory
 * @Descrition:
 * @Author:shoulei
 * @Date:2019/3/31 17:04
 * @Verson:
 */
public class ShapeFactory extends AbstractFactory{
    @Override
    Color getColor(String color) {
        return null;
    }

    @Override
    Shape getShape(String shapeType) {
        if(shapeType == null){
            return null;
        }
        if(shapeType.equalsIgnoreCase("rectangle")){
            return  new Rectangle();
        }else if(shapeType.equalsIgnoreCase("square")){
            return  new Square();
        }else if(shapeType.equalsIgnoreCase("circle")){
            return  new Circle();
        }
        return null;
    }
}
